<include file="public:header" />
<div class="pad-10" >
    <form id="myform" name="myform" action="{:u('links_city/del')}" method="post" onsubmit="return check();">
    <div class="table-list" style="width: 400px;">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width="4%"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
              	<th width="80">城市</th>
                <th width="80">全拼</th>
              	<th width="80">简拼</th> 
                <th width="80">操作</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="links_city" id='val'>
        <tr>
            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>
            <td align="center">{$val.name}</td>
            <td align="center">{$val.pin}</td>
            <td align="center">{$val.pre_letter}</td>
            <td align="center"><a class="blue" href="{:u('links_city/edit',array('id'=>$val['id']))}">编辑</a></td>
        </tr>
        </volist>
    	</tbody>
    </table>

    <div class="btn">
    <label for="check_box">全选/取消</label>
    <input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')"/>
    </div>

    </div>
    </form>
</div>
<script type="text/javascript">
$(function(){
	$('.expandable').toggle(
		function(){
			$('.sub_'+$(this).attr('id')).hide();
			$(this).attr('src',ROOT_PATH+'/statics/admin/images/tv-expandable.gif');
		},
		function(){
			$('.sub_'+$(this).attr('id')).show();
			$(this).attr('src',ROOT_PATH+'/statics/admin/images/tv-collapsable.gif');
		}
	);
});

var lang_items_cate_name = "商品分类";
function check(){
	if($("#myform").attr('action') == '{:u("items_cate/delete")}') {
		var ids='';
		$("input[name='id[]']:checked").each(function(i, n){
			ids += $(n).val() + ',';
		});

		if(ids=='') {
			window.top.art.dialog({content:lang_please_select+lang_items_cate_name,lock:true,width:'200',height:'50',time:1.5},function(){});
			return false;
		}
	}
	return true;
}
function status(id,type){
    $.get("{:u('items_cate/status')}", { id: id, type: type }, function(jsondata){
		var return_data  = eval("("+jsondata+")");
		$("#"+type+"_"+id+" img").attr('src', 'http://img.chachiwang.com/images/status_'+return_data.data+'.gif')
	}); 
}
</script>
</body>
</html>